#include<func.h>
#include<mysql/mysql.h>

typedef struct ret_val_s
{
    int check_value ;
    char path_info[1024] ;
} ret_val_t ;

typedef struct ret_cddots_s
{
    int pre_id ;
    char path[100] ;
}ret_cddots_t

int cd_m(MYSQL *db ,char *current_path,char *target_path)












//ret_val_t pwd_m(void) ;
//int mkdir_m(const char*path , mode_t mode) ;
//int cut_path(char *path ,char *user_name) ;
//int reunit_path(char *rootpath ,char *usr_path) ;



// ret_val_t cd_m(MYSQL db,char *md5_name,char *target_path)
// {
//     ret_val_t ret_info ;
//     ret_info.check_value = 0 ;
//     memset(ret_info.path_info,0,sizeof(ret_info.path_info)) ;

//     const char two_dots[] = "..";
//     const char four_dots[] = "../..";
//     const char root_symbol[] = "~";
//     //select md5_name to get file path ;
    

//     if(strcmp(target_path,root_symbol) == 0)
//     {
//         if()
//     }
//     else if(strcmp(target_path,two_dots) == 0)
//     {

//     }
//     else if(strcmp(target_path,four_dots) == 0)
//     {

//     } 

//     if(target_path == )
//     char *sql = "select * from FileTable" ;

// }

//db open
/*
#include"head.h"


ret_val_t cd_m(char *md5_name,char *target_path)
{
    ret_val_t ret_info ;
    ret_info.check_value = 0 ;
    memset(ret_info.path_info,0,sizeof(ret_info.path_info)) ;

    MYSQL *db = mysql_init(NULL) ;
    char *host = "localhost" ;
    char *user = "root" ;
    char *password = "kkksql123" ;
    char *database = "workfile" ;

    MYSQL *ret = mysql_real_connect(db,host,user,passwd,database,0,NULL,0) ;
    if(ret == NULL )
    {
        ret_info.check_value = -1 ;
        strcpy(ret_info.path_info,mysql_error(db)) ;

        mysql_close(db);
        return ret_info ;
    }
    else
    {
        char *sql = "select * from FileTable" ;
    }

    mysql_close(db);
}
*/
